The proliferation of imaging technology, combined with ever increasing computational processing power, has led to many advances in the area of document analysis. Document analysis systems may be used to extract semantic information from a scanned document, and the technology is being used in a growing number of applications.
One such application of this technology is to the problem of efficiently storing the information generated from scanned documents in a low memory footprint while maintaining visual quality. A popular format for digitised documents is the Portable Document Format (PDF). Scanned documents are often represented in this format using a combination of a high resolution foreground image, and a background image at a lower resolution and/or higher compression ratio.
Document image analysis for compression involves identifying and separating the scanned image components into these foreground and background layers and compressing the layers separately. The foreground layer may consist of flat filled objects which are stored in memory encoded as bit masks, with the content of each mask represented by a single colour. These flat filled objects are typically the information bearing objects on the page, such as text, tables, and line drawings. This ensures, for example, that text characters remain crisp and legible. The background layer may then have the foreground component removed using inpainting for compression efficiency. Typically the average colour of the pixels surrounding the foreground mask is used for inpainting, and the background is then saved in a compressed image format, such as JPEG.
A problem facing the technique described above is the accurate reproduction of document colours, as the foreground mask colour and inpainted background colour are often polluted by artefacts such as noise and colour bleeding. Such colour pollution may have been caused by printer anti-aliasing, scanner aliasing, chromatic aberrations, and other blurring, haloing or fringing effects.
A basic approach to determining the colour to assign the foreground object is to use the average colour value of the pixels which form the object, for example a text character. This method may be extended to use the average value of other nearby similarly coloured objects, such as all characters in a line of text. This method tries to average out colour pollution errors over a number of pixels, optimistically assuming that such artefacts are, on average, insignificant.
A known extension to the averaging process is to “snap” colours to basic values: colours that are very close to black will be set to pure black, and those close to white set to pure white. A further extension to this is to snap the value of individual colour components, for example CMYK, increasing the component value to maximum saturation if above a certain threshold level, while possibly reducing others.
A further approach to improving the colour of scanned documents is to apply known colour enhancement image processing algorithms to the input scanned page, such as increasing the colour saturation of all pixels by a specified amount. Another such approach is to stretch the dynamic range of the input scan colours, so that the lightest pixel becomes pure white, the darkest pixel is set to pure black, and all other values are stretched proportionally between these two extremes.
Such techniques applied indiscriminately across the page ignore the individual characteristics of the page elements and may reduce colour variations in dark or bright areas. Though the colours of information bearing objects may be enhanced, the image quality in photographic regions may decrease due to a reduction in colour variation. From a users' subjective interpretation of a document image, the information bearing objects dominate the overall visual quality of a page. It is more desirable that the colour enhancement techniques only be applied to the information bearing objects for a document image.
There is a need to accurately reproduce the colours of the information bearing objects on a document image and it is also preferable to enhance these colours to improve the subjective visual quality.